/**
 * 
 */
package com.blueocean_health.care.management.transfer.client;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import com.blueocean_health.care.management.transfer.client.TestClient.HystrixClientFallback;



/**
* @Title: TestClient.java
* @Package com.blueocean_health.care.management.transfer.client
* @author lcx
* @date 2018年7月3日
* @version V1.0
*/
@FeignClient(value = "orderserver",fallback = HystrixClientFallback.class)
public interface  TestClient {
	@RequestMapping(value = "/orderfeigntest",method = RequestMethod.POST)
	    String orderfeigntest(@RequestParam(value = "name") String name);
	
	 @Component
	  static class HystrixClientFallback implements TestClient {
		    private static Logger logger = LoggerFactory.getLogger(HystrixClientFallback.class);

		@Override
		public String orderfeigntest(@RequestParam(value = "name") String name) {
		    	logger.info("异常发生，进入fallback方法，接收的参数："+name);
		    	
			return "feign-hystrix";
		}
	  }
}
